package cn.edu.scau.cmi.xuandingcong.singleton;

import java.util.ArrayList;

public class Marshals {
	String name ;
	static int frag =0;
	private static ArrayList<Marshals> list = new ArrayList<Marshals>(); 
	public Marshals(String name){
		this.name = name ;
	}
	
	public static ArrayList<Marshals> addInstance(String name){
		if(list.size() < 10) {
			Marshals p = new Marshals(name);
			list.add(p);
		}
		else {
			frag = 1;
		}
		return list;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	public ArrayList<Marshals> getInstance(){
		return list;
	}
	
}
